<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <base href="${basePath }" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="3rd/ligerui/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css"/>
    <script src="3rd/ligerui/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="3rd/ligerui/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function queryData(){
            manager.setOptions({
                parms: $('#queryForm').serializeArray()
            });
            manager.loadData();
        }
        var examWin,manager;
        $(function(){
            manager = $("#content").ligerGrid({
                checkbox: true,
                columns: [
                    {name:'id',hide:1},
                    { display: '标题', name: 'title', align: 'left', width: 200 },
                    { display: '类型', name: 'type', minWidth: 60 },
                    { display: '状态', name: 'status', width: 70,align:'left' },
                    { display: '点击次数', name: 'click', width: 60 },
                    { display: '排序索引', name: 'sort', width: 60 },
                    { display: '创建时间', name: 'created' }
                ], dataAction: 'server',pageSize:30,
                root:"rows",
                record:"total",
                url: "${basePath}article/list.shtml", sortName : 'sort',sortOrder:"desc",
                width: '99%',height:'370'
            });

            $('#queryForm').ligerForm();

            $("#confirm").click(function(){
                var status = $('#examForm input[name=status]:checked');
                if(status.length){
                    $.post("article/exam.shtml",$('#examForm').serializeArray(),function(data){
                        examWin.hidden();
                        $.ligerDialog.success('操作成功！',function(){
                            $('#examForm input[name=status]:checked').attr('checked',false);
                            queryData();
                        });
                    });
                } else {
                    examWin.hidden();
                    $.ligerDialog.question("请先选择数据！",function(){
                        examWin.show();
                    });
                }
            });

            $('#queryBtn').click(function(){
                queryData();
            });

            $('#btn').ligerButton({
                click:function(){
                    var rows = manager.getSelecteds();
                    parent.getSel(rows);
                },
                text:"确定"
            });
        });
    </script>
    <style type="text/css">
        #examine table tr{
            height:25px;
        }
        tr {
            line-height: 30px;
        }
        div.query {
            width: 750px;
            height: 32px;
            border: 1px #e0e4e2 solid;
            background-color: #eeeeee;
            margin: 5px;
        }
        #btn{
            margin: 14px 0 0 328px;
        }
    </style>
    <title>文章列表</title>
</head>
<body>
<form id="queryForm">
    <div class="query">
        <table cellspacing="3">
            <tr>
                <td>&nbsp;&nbsp;标题：</td><td><input name="title" /></td>
                <td>&nbsp;&nbsp;类型：</td><td><select name="type">
                <option value="">请选择</option>
                <option value="A">文章模型</option>
                <option value="V">视频模型</option>
                <option value="P">图片模型</option>
                <option value="I">图集模型</option>
                <option value="S">分类模型</option>
            </select></td>
                <td>&nbsp;&nbsp;状态：</td><td><select name="status">
                <option value="">请选择</option>
                <option value="1">待审核</option>
                <option value="2">审核不通过</option>
                <option value="3">审核通过</option>
                <option value="4">已发布</option>
            </select></td>
                <td>&nbsp;&nbsp;<input type="button" id="queryBtn" value="查询" />&nbsp;&nbsp;
                </td>
            </tr>
        </table>

    </div>
</form>

<div id="content" style="margin:0; padding:0"></div>

<div id="btn"></div>
</body>
</html>